cmake_minimum_required(VERSION 3.14)
if (ANDROID)
    MESSAGE("安卓")
elseif(IOS_PLATFORM)
    MESSAGE("苹果手机")
elseif(APPLE)
    MESSAGE("非苹果手机的苹果设备")
elseif(WIN32)
    MESSAGE("windows")
else()
    MESSAGE("其他")
endif()
# MESSAGE(${IOS_PLATFORM})
project(NativeComplie VERSION 0.1.0)

set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
# include(CTest)
# enable_testing()
file(GLOB sourceFile
        "*.cpp")
if (ANDROID)
    MESSAGE("安卓")
    add_library( # Sets the name of the library.
            NativeComplie

            # Sets the library as a shared library.
            SHARED

            # Provides a relative path to your source file(s).
            ${sourceFile}
        )
elseif(IOS_PLATFORM)
	SET(CMAKE_C_FLAGS_DEBUG "-g -Wall")          #指定编译器
	SET(CMAKE_CXX_FLAGS_DEBUG "-g -Wall")          #指定编译器
    MESSAGE("苹果手机")
    add_library( # Sets the name of the library.
        NativeComplie

        # Sets the library as a shared library.
        SHARED

        # Provides a relative path to your source file(s).
        ${sourceFile})
else()
 
    add_executable(NativeComplie ${sourceFile})
    include(CPack)

endif()



# cmake_minimum_required(VERSION 3.14)
# if (TEST_AUGUS_ENGINE)
# 	project(augus_test)
# else()
# 	project(augus)
# endif()

# # for detect attention 
# ADD_DEFINITIONS(-D ATTENTION_SUPPORTED)
# aux_source_directory(../ ALL_SRCS)

# option(DEBUG_MNN "Debug MNN" OFF)

# if(DEBUG_MNN) 
# 	add_definitions(-D DEBUG_MNN)
# endif()

# if(TEST_AUGUS_ENGINE)
# 	add_definitions(-D TEST_AUGUS_ENGINE)
# endif()

# #ADD_SUBDIRECTORY(faceClient)
# #INCLUDE_DIRECTORIES(faceClient/src)
# #SET(JSONCPP_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/faceClient/deps/jsoncpp/include")
# #MESSAGE(STATUS "JSONCPP ${JSONCPP_INCLUDE_DIR}")
# #INCLUDE_DIRECTORIES(${JSONCPP_INCLUDE_DIR})

# if(WIN32)
# 	set(MNN_ROOT "../../../MNN") 	# Put MNN as neightbour of this project on windows
# else()
# 	set(MNN_ROOT "../../../MNN")
# endif()

# #find_package(OpenCV REQUIRED)
# MESSAGE(STATUS "MNN_ROOT: ${MNN_ROOT}")

# set(CMAKE_C_STANDARD 99)
# set(CMAKE_CXX_STANDARD 11)

# # put output to build dir
# SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
# include_directories("/usr/local/include")
# include_directories(${MNN_ROOT}/3rd_party/imageHelper/)
# include_directories("../")
# include_directories("../include")
# include_directories("${MNN_ROOT}/include")
# include_directories("../../third-party/")
# if(DEBUG_MNN)
# 	include_directories("${MNN_ROOT}/3rd_party/flatbuffers/include")
# 	include_directories("${MNN_ROOT}/source")
# 	include_directories("${MNN_ROOT}/schema/current")
# endif()
# #include_directories(${OpenCV_INCLUDE_DIRS})
# #link for libMnn
# if(ANDROID)
# 	include_directories("../../third-party/android/include/opencv4")
# 	link_directories("../../third-party/android/lib")#android
# 	link_directories("../release/release_for_ad/lib")#android
# elseif(IOS)
# 	include_directories("../../third-party/ios/opencv_include")
# 	link_directories("../../third-party/ios/lib") # for iOS
# elseif(WIN32)
# 	include_directories("../../third-party/win32/opencv/include")
# 	set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MDd /ZI")
# 	set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD /Zi")
# 	link_directories("../../third-party/win32/lib")
# 	IF(CMAKE_BUILD_TYPE MATCHES Debug)
# 		link_directories("../../third-party/win32/opencv/staticlib/Debug") # for win32
# 	else()
# 		link_directories("../../third-party/win32/opencv/staticlib/Release") # for win32
# 	endif()
# else(IOS)
# 	SET(CMAKE_C_FLAGS_DEBUG "-g -Wall")          #指定编译器
# 	SET(CMAKE_CXX_FLAGS_DEBUG "-g -Wall")          #指定编译器

# 	if(APPLE AND NOT IOS)
# 		include_directories("../../third-party/macos/opencv_include")
# 		link_directories("../release/release_for_macos/lib")#linux
# 		link_directories("../../third-party/macos/lib") 
# 	else()
# 		link_directories("../release/release_for_linux/lib")#linux
# 		link_directories("${MNN_ROOT}/build/" "/home/gong/code/opencvlib/lib") 
# 		include_directories("/home/gong/code/opencvlib/include/opencv4/")
# 	endif()
# endif()

# SET(CMAKE_CXX_FLAGS_RELEASE"$ENV{CXXFLAGS} -O3 -Wall")

# if(WIN32)
# 	SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DAUGUS_EXPORTS")
# endif()

# if (TEST_AUGUS_ENGINE)
# 	list(FILTER ALL_SRCS EXCLUDE REGEX ".*faceEngine\.cpp")
# 	add_library(augus_test SHARED ${ALL_SRCS})
# else()
# 	list(FILTER ALL_SRCS EXCLUDE REGEX ".*faceEngine_mock\.cpp")
# 	add_library(augus SHARED ${ALL_SRCS})
# endif()

# #MESSAGE("FaceClient ${faceclient}")
# if (ANDROID)
# 	target_link_libraries(augus MNN log opencv_calib3d opencv_imgproc opencv_flann opencv_features2d opencv_core tegra_hal zlib cpufeatures) 
# elseif(IOS)
# 	set_target_properties(augus PROPERTIES FRAMEWORK TRUE)
# 	set_target_properties(augus PROPERTIES
# 		XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER com.yqzy.augus
# 		XCODE_ATTRIBUTE_CURRENT_PROJECT_VERSION 1.1.7
# 		XCODE_ATTRIBUTE_MARKETING_VERSION 1.1.7
# 	)
# 	set_target_properties(augus PROPERTIES MACOSX_FRAMEWORK_INFO_PLIST "../misc/ios/Info.plist")

# 	set_property(TARGET augus PROPERTY XCODE_ATTRIBUTE_FRAMEWORK_SEARCH_PATHS "../../third-party/ios/lib")
# 	set_property(TARGET augus PROPERTY XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "Apple Development: feng rao (CW958S3365)")
# 	set_property(TARGET augus PROPERTY XCODE_ATTRIBUTE_CODE_SIGN_STYLE "Manual")
# 	set_property(TARGET augus PROPERTY XCODE_ATTRIBUTE_DEVELOPMENT_TEAM "A65ALW8Y6M")
# 	set_property(TARGET augus PROPERTY XCODE_ATTRIBUTE_GCC_GENERATE_DEBUGGING_SYMBOLS "YES")
# 	target_link_libraries(augus PRIVATE opencv_world ade zlib "-framework MNN" "-force_load ../../third-party/ios/lib/MNN.framework/MNN") # for LM3C
# elseif(APPLE)	
# 	target_link_libraries(augus ade zlib libjpeg-turbo libopenjp2 libpng libtiff libwebp MNN  opencv_world "-framework Accelerate" "-framework OpenCL") # for LM3C
# elseif(WIN32)
# 	IF(CMAKE_BUILD_TYPE MATCHES Debug)
# 		if(TEST_AUGUS_ENGINE)
# 			target_link_libraries(augus_test MNN-d opencv_world451d IlmImfd ippicvmt ippiwd ittnotifyd zlibd) # for LM3C
# 		else()
# 			target_link_libraries(augus MNN-d opencv_world451d IlmImfd ippicvmt ippiwd ittnotifyd zlibd) # for LM3C
# 		endif()
# 	else()
# 		if(TEST_AUGUS_ENGINE)
# 			target_link_libraries(augus_test MNN opencv_world451 IlmImf ippicvmt ippiw ittnotify zlib) # for LM3C
# 		else()
# 			target_link_libraries(augus MNN opencv_world451 IlmImf ippicvmt ippiw ittnotify zlib) # for LM3C
# 		endif()
# 	endif()
# else()
# 	if(TEST_AUGUS_ENGINE)
# 		target_link_libraries(augus_test MNN) # for LM3C
# 	else()
# 		target_link_libraries(augus MNN ) # for LM3C
# 	endif()
# endif()

# #target_link_libraries(augus MNN ${OpenCV_LIBS}) # for LM3C
